package com.liaowei.post.openfeign;

import com.liaowei.common.BaseResponse;
import com.liaowei.model.param.PostHistoryParam;
import com.liaowei.model.vo.UserVO;
import com.liaowei.post.config.OpenFeignConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = "user-service",configuration = OpenFeignConfig.class)
public interface UserClient {
    @GetMapping("/users/{userId}")
    BaseResponse<UserVO> getById(@PathVariable Long userId);

    // 新增帖子历史记录
    @PostMapping("/users/posts/histories")
    BaseResponse<String> addPostHistory(@RequestBody PostHistoryParam postHistoryParam);

    // 根据用户id和帖子id删除帖子记录
    @DeleteMapping("/users/posts/histories/{userId}/{postId}")
    BaseResponse<String> deletePostHistoryByUserIdAndPostId(@PathVariable("userId") Long userId,
                                                            @PathVariable("postId") Long postId);

}
